#※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
# File Name: python_pkgs.sh
# Author: GID5564
# Description:
# Created Time: 03/05/23-16:47:44
#※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
#! /usr/bin/bash


#编译安装最新版opencv
function install_opencv(){
    apt update && apt upgrade -y
    apt_install make cmake gcc g++
    
    #要支持python2，请执行以下操作：
    #sudo apt-get安装python-dev python-numpy
    #要支持python3，请执行以下操作：
    apt_install python3-dev python3-numpy
    #接下来我们需要GTK支持GUI功能、摄像机支持(V4L)、媒体支持(ffmpeg、gstreamer)等。

    apt_install libavcodec-dev libavformat-dev libswscale-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libavresample-dev libdc1394-22-dev

    #要支持gtk2，gtk3
    apt_install libgtk2.0-dev libgtk-3-dev
    #可选依赖项-图片
    apt_install libpng-dev libjpeg-dev  libopenexr-dev libtiff-dev libwebp-dev
    
    
    git clone ${MYGIT}/opencv.git /home
    
    cd /home/opencv
    #创建构建文件夹并进入
    mkdir build
    cd build
    #构建配置:用于配置OpenCV库构建(从构建文件夹执行)：
    cmake ../
    #编译安装
    make && make install
    
}























